package com.bawei.mall.user.controller;

import com.bawei.common.core.domain.R;
import com.bawei.mall.user.domain.MallProductFootPrint;
import com.bawei.mall.user.service.FootPrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/member/readHistory")
public class FootPrintController {
    @Autowired
    private FootPrintService footPrintService;

    @GetMapping("/list")
    public R<List<MallProductFootPrint>> list(){
        List<MallProductFootPrint> list = footPrintService.list();
        return  R.ok(list);
    }



    @PostMapping("/create")
    public R create(@RequestBody MallProductFootPrint mallProductFootPrint){
        footPrintService.create(mallProductFootPrint);
        return R.ok();
    }

    @PostMapping("/clear")
    public R clear(){
        footPrintService.clear( );
        return R.ok();
    }

}
